package com.app.controller;

import com.app.service.AdminUserService;
import com.app.service.BannerService;
import com.app.service.CategoryService;
import com.app.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RestController
@RequestMapping("/api")
public class BannerController {
    @Autowired
    private BannerService bannerService;

    @Autowired
    private CategoryService categoryService;

    //首页轮播图
    @GetMapping("/selectBanner")
    public Result<Object> selectBanner() {
        return Result.success(bannerService.selectBanner());
    }

    /**
     * 查询审批情况
     *
     * @return {@link Result }<{@link Object }>
     */
    @GetMapping("/queryApprovalStatus")
    public Result<Object> queryApprovalStatus()
    {
        return Result.success(this.categoryService.getCategoryByName("审核状态"));
    }

}
